package com.hitqz.robot.api.business.model.vo.robot;

import com.hitqz.robot.api.business.enums.WorkStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author xupkun
 * @date 2024/5/22
 */
@Schema(description = "机器人详情展示")
public class RobotVo implements Serializable {

    @Schema(description = "机器人编码")
    private String robotSn;

    @Schema(description = "机器人名称")
    private String robotName;

    @Schema(description = "工作状态")
    private String workStatus;

    @Schema(description = "工作状态描述")
    private String workStatusStr;

    @Schema(description = "在线状态")
    private String onlineStatus;

    @Schema(description = "机器人在线状态描述")
    private String onlineStatusStr;

    @Schema(description = "充电阈值")
    private int chargeThreshold;

    @Schema(description = "工作阈值")
    private int workThreshold;

    @Schema(description = "地图编码")
    private String mapCode;

    @Schema(description = "地图名称")
    private String mapName;

    @Schema(description = "机器人宽度")
    private int robotWidth;

    @Schema(description = "机器人长度")
    private int robotLength;

    @Schema(description = "机器人旋转直径")
    private int robotAngleLength;

    private String serverAddress;

    private String ipAddress;

    @Schema(description = "机器人模型图片地址")
    private String robotModelPath;

    @Schema(description = "外部访问 ip")
    private String externalIp;

    @Schema(description = "外部访问 端口")
    private String externalPort;

    @Schema(description = "机器人驱动类型")
    private String robotDriver;

    public String getRobotSn() {
        return robotSn;
    }

    public void setRobotSn(String robotSn) {
        this.robotSn = robotSn;
    }

    public String getRobotName() {
        return robotName;
    }

    public void setRobotName(String robotName) {
        this.robotName = robotName;
    }

    public String getWorkStatus() {
        return workStatus;
    }

    public void setWorkStatus(String workStatus) {
        this.workStatus = workStatus;
    }

    public String getOnlineStatus() {
        return onlineStatus;
    }

    public void setOnlineStatus(String onlineStatus) {
        this.onlineStatus = onlineStatus;
    }

    public int getChargeThreshold() {
        return chargeThreshold;
    }

    public void setChargeThreshold(int chargeThreshold) {
        this.chargeThreshold = chargeThreshold;
    }

    public String getMapCode() {
        return mapCode;
    }

    public void setMapCode(String mapCode) {
        this.mapCode = mapCode;
    }

    public String getMapName() {
        return mapName;
    }

    public void setMapName(String mapName) {
        this.mapName = mapName;
    }


    public int getRobotWidth() {
        return robotWidth;
    }

    public void setRobotWidth(int robotWidth) {
        this.robotWidth = robotWidth;
    }

    public int getRobotLength() {
        return robotLength;
    }

    public void setRobotLength(int robotLength) {
        this.robotLength = robotLength;
    }

    public int getRobotAngleLength() {
        return robotAngleLength;
    }

    public void setRobotAngleLength(int robotAngleLength) {
        this.robotAngleLength = robotAngleLength;
    }

    public String getServerAddress() {
        return serverAddress;
    }

    public void setServerAddress(String serverAddress) {
        this.serverAddress = serverAddress;
    }


    public String getWorkStatusStr() {
        return WorkStatusEnum.CMD_ROBOT_STATUS.get(workStatus).getDesc();
    }

    public void setWorkStatusStr(String workStatusStr) {
        this.workStatusStr = workStatusStr;
    }

    public String getOnlineStatusStr() {
        return Objects.equals(onlineStatus, "1") ? "在线": "离线";
    }

    public void setOnlineStatusStr(String onlineStatusStr) {
        this.onlineStatusStr = onlineStatusStr;
    }


    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }


    public String getRobotModelPath() {
        return robotModelPath;
    }

    public void setRobotModelPath(String robotModelPath) {
        this.robotModelPath = robotModelPath;
    }

    public String getExternalIp() {
        return externalIp;
    }

    public void setExternalIp(String externalIp) {
        this.externalIp = externalIp;
    }

    public String getExternalPort() {
        return externalPort;
    }

    public void setExternalPort(String externalPort) {
        this.externalPort = externalPort;
    }

    public int getWorkThreshold() {
        return workThreshold;
    }

    public void setWorkThreshold(int workThreshold) {
        this.workThreshold = workThreshold;
    }


    public String getRobotDriver() {
        return robotDriver;
    }

    public void setRobotDriver(String robotDriver) {
        this.robotDriver = robotDriver;
    }
}
